import thin_render from "./thin_render.mjs";
import { nearest_data } from "./nearest.mjs";
import datarover from "./datarover.mjs";
export default function (container, template) {
  if (
    typeof template.if === "function"
      ? template.if({ container: container, data: nearest_data(container) })
      : typeof template.if === "string"
      ? datarover(container, template.if)
      : template.if
  ) {
    thin_render(container, template.then);
  } else {
    if (template.else) {
      thin_render(container, template.else);
    }
  }
}
